<?php

namespace api\zwt\route;

use api\zwt\middleware\CheckToken;
use think\facade\Route;


//用户相关的路由
Route::group('admin',function(){
    //注册路由
    Route::post('register','zwt/User/register');
    //登录
    Route::post('login','zwt/User/login');
    //验证码
    Route::post('code','zwt/User/sendCode');
    //充值
    Route::post('money','zwt/Wallet/money')->middleware(CheckToken::class);
});
//上传
Route::group('update',function(){
    //上传
    Route::post('local','zwt/update/local');
    Route::post('qiniu','zwt/update/qiniu');
});

Route::group('edit',function(){
    //修改
    Route::post('getUserInfo','zwt/User/getUserInfo');
    Route::post('UserEdit','zwt/User/UserEdit');
})->middleware(CheckToken::class);;

//收货信息
Route::group('delivery',function() {
    //查询收货地址列表
    Route::get('list', 'zwt/DeliveryAddress/getAddressList');
    //添加收货地址
    Route::post('add', 'zwt/DeliveryAddress/addAddress')->middleware(CheckToken::class);
    //修改收货地址
    Route::post('edit', 'zwt/DeliveryAddress/editAddress')->middleware(CheckToken::class);
    //删除
    Route::get('delete', 'zwt/DeliveryAddress/delete');
});


Route::group('order',function (){
    //商品支付购买
    Route::post('order','api/zwt/Order/order');
    //商品支付信息
    Route::post('pay','api/zwt/Pay/walletPay');
})->middleware(CheckToken::class);

